<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            counter-reset: sec;
            margin-left: 200px;
        }

        h1 {
            counter-reset: sub;
        }

        h1::before {
            counter-increment: sec;
            content: counter(sec) '. ';
        }

        h2 {
            height: 30px;
            width: 300px;
            background-color: #f4f4f4;
            font-size: 20px;
        }

        h2::before {
            display: inline-block;
            counter-reset: progress var(--precent);
            content: counter(progress) "%";
            background-color: #2486ff;
            max-width: 300px;
            width: calc(1% * var(--precent) );
            white-space: nowrap;
            text-align: center;
            font-size: 20px;
            color: #fff;
        }

    </style>
</head>
<body>
<div class="box">
    <h1>进度条</h1>
    <h2 style="--precent:30;"></h2>
    <h2 style="--precent:60;"></h2>
    <h2 style="--precent:150;"></h2>

</div>

</body>
</html>

